home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DragTxPv.h
-
- Contains: Static functions for DragText
-
- Owned by: Craig Carper
-
- Copyright: © 1993-1995 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <5> 6/28/95 CC 1262618: Added GetFSSpecFromHFSProperty(),
- ReadTextFile(), InsertFromTextFile(),
- SURemoveValue(), and IsFrontProcess().
- <4> 6/5/95 TJ Moved the Document Structure from the IDL
- file into this one.
- <3> 11/28/94 CC Checkin of changes to revision 2 noted
- below.
- <2+> 11/14/94 CC Added DrawLinkBorder.
- <2> 9/30/94 CC 1189416 - Utility functions for DragText
- 'ternalization.
- <1> 9/29/94 RA first checked in
- <1> 9/8/94 CC first checked in
-
- To Do:
- */
-
- #ifndef _DRAGTXPV_
- #define _DRAGTXPV_
-
- #ifndef _PLFMDEF_
- #include "PlfmDef.h"
- #endif
-
- #ifndef _ALTPOINT_
- #include "AltPoint.h" // Use C++ savvy ODPoint and ODRect
- #endif
-
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- #endif
-
- #ifndef __TEXTEDIT__
- #include <TextEdit.h>
- #endif
-
- #ifndef __STRING__
- #include <String.h>
- #endif
-
- #ifndef __OSUTILS__
- #include <OSUtils.h> // SysBeep, GetDateTime, etc.
- #endif
-
- #ifndef __OSEVENTS__
- #include <OSEvents.h>
- #endif
-
- #ifndef __TOOLUTILS__
- #include <ToolUtils.h> // HiWord etc.
- #endif
-
- #ifndef __SCRAP__
- #include <Scrap.h>
- #endif
-
- #ifndef __LOWMEM__
- #include <LowMem.h>
- #endif
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
- #ifndef __QDOFFSCREEN__
- #include "QDOffscreen.h" // for GWorldPtr, StScrpHandle
- #endif
-
- #ifndef __DIALOGS__
- #include "Dialogs.h"
- #endif
-
- //==============================================================================
- // TypeDefs
- //==============================================================================
-
- typedef struct WindowOffscreen {
- CGrafPtr windowPort;
- GDHandle windowDevice;
- GWorldPtr offscreenWorld;
- } WindowOffscreen;
-
- //==============================================================================
- // Structs
- //==============================================================================
-
- struct Document
- {
- WindowPtr theWindow;
- TEHandle theTE;
- ODSShort docTop;
- RgnHandle hiliteRgn;
- ControlHandle vScroll, hScroll;
- ODSShort vScrollPos;
- ODHandle undoDragText;
- ODSShort undoSelStart, undoSelEnd;
- ODSShort lastSelStart, lastSelEnd;
- ODFrame* theFrame;
- ODBoolean frameIsActive, caretShow, cursorInContent, canAccept;
- ODULong caretTime;
- ODSShort caretOffset, lastOffset, insertPosition;
- };
-
-
- //==============================================================================
- // Functions
- //==============================================================================
-
- extern WindowOffscreen *DrawOffscreen(WindowPtr theWindow);
- extern void DrawOnscreen(WindowOffscreen *theOffscreen);
- extern void DrawCaret(short offset, TEHandle theTE, RgnHandle clipRgn);
- extern void InsertTextAtOffset(short offset, char *theBuf, long size, StScrpHandle theStyl, TEHandle theTE);
- extern Boolean WhiteSpaceAtOffset(short offset, TEHandle theTE);
- extern Boolean WhiteSpace(char theChar);
- extern char GetCharAtOffset(short offset, TEHandle theTE);
- extern short TEIsFrontOfLine(short offset, TEHandle theTE);
- extern short TEGetLine(short offset, TEHandle theTE);
- extern pascal void ScrollProc(ControlHandle theControl, short theCode);
- extern void AdjustDocumentView(Document *theDocument);
- extern ODBoolean ValueOnClipboard(Environment *ev, ODValueType type, ODSession* session);
- extern ODBoolean LinkSpecInSU(Environment *ev, ODStorageUnit* su);
- extern ODBoolean IncludedInRange(ODSShort start, ODSShort end, ODSShort startRange, ODSShort endRange);
- extern ODBoolean RangesOverlap(ODSShort start1, ODSShort end1,ODSShort start2,ODSShort end2);
- extern ODBoolean IsKind(ODType type, ODISOStr kind);
- extern ODBoolean PasteThisKind(Environment *ev, ODStorageUnit* su, ODType aKind, ODType specifiedKind);
- extern char PeekIntoValue(Environment *ev, ODStorageUnit* su, ODValueType kind, ODSLong offset);
- extern void TempSelect(ODSShort start, ODSShort end, TEHandle theTE, ODBoolean isActive);
- extern ODPoint GetAggregateTranslation(Environment *ev, ODFacet* facet);
- extern void CheckMarkMenu(MenuHandle menu, Str255 checkItem, ODBoolean checkIt);
- extern ODBoolean OneDragItem(Environment *ev, ODDragItemIterator* dropInfo);
- extern ODBoolean SUExistsThenFocus(Environment* ev, ODStorageUnit* su, ODPropertyName prop, ODValueType type);
- extern void SUForceFocus(Environment* ev, ODStorageUnit* su, ODPropertyName prop, ODValueType type);
- extern void SUSetValue(Environment* ev, ODStorageUnit* su, ODValue value, ODULong size);
- extern void SUFocusAndSetValue(Environment* ev,
- ODStorageUnit* su,
- ODPropertyName prop,
- ODValueType type,
- ODValue value,
- ODULong size);
- extern void SURemoveProperty(Environment* ev, ODStorageUnit* su, ODPropertyName prop);
- extern void SURemoveValue(Environment* ev, ODStorageUnit* su, ODPropertyName prop, ODValueType type);
- RgnHandle LineBorderFromRange(ODSShort* startOffset, ODSShort endOffset, TEHandle theTEHandle);
- extern void DrawLinkBorder(Environment *ev,
- ODFacet* facet,
- ODSShort linkStart,
- ODSShort linkEnd,
- TEHandle theTEHandle,
- LinkBorderStyle borderStyle);
-
- pascal Boolean DragTextDialogFilter(DialogPtr dialog,
- EventRecord* event,
- short* itemHit);
- ODBoolean GetFSSpecFromHFSProperty(Environment* ev,
- ODStorageUnit* su,
- FSSpec* fileSpec);
- extern ODHandle ReadTextFile(FSSpec* fileSpec, ODBoolean* truncated);
- extern void InsertFromTextFile(FSSpec* fileSpec, TEHandle theTE, ODULong insertPosition);
-
- extern ODBoolean IsFrontProcess();
-
- #endif // _DRAGTXPV_
-
-